﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace TravelWeb.Models
{
    [Bind(Exclude = "ScheduleID")]
    public class Schedule
    {
        [ScaffoldColumn(false)]
        public int ScheduleID { get; set; }
        [Required(ErrorMessage = "Schedule Name is required")]
        [DisplayName("Schedule Name")]
        [StringLength(160)]
        public String ScheduleName { get; set; }
        [ScaffoldColumn(false)]
        public int? TourID { get; set; }
        [ScaffoldColumn(false)]
        public int? TransportationID { get; set; }
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
        [DisplayName("Enroll deadline")]
        public DateTime ConfirmDate { get; set; }
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
        [DisplayName("Date start")]
        public DateTime StartDate { get; set; }
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd/MM/yyyy}")]
        [DisplayName("Date end")]
        public DateTime EndDate { get; set; }
        [Required(ErrorMessage = "Description is required")]
        public String Description { get; set; }
        [DisplayName("Number of customer enrolled")]
        public int numOfCustomer { get; set; }
        [ScaffoldColumn(false)]
        public int? PromotionID { get; set; }
        [Range(20, 100, ErrorMessage = "Have to be at least 20 and at most 100 customers for a schedule")]
        [DisplayName("Size of trip")]
        public int MaxCustomer { get; set; }
        [ScaffoldColumn(false)]
        public String Status { get; set; }

        public Tour Tour { get; set; }
        public Transportation Transportation { get; set; }
        public Promotion Promotion { get; set; }
        public List<Schedule> Schedules { get; set; }
    }

    public class ScheduleKey
    {
        public int? TourID { get; set; }
        public int? PromotionID { get; set; }
    }
}